# name : lag with ifn
# key : lag.ifn
# contributor: Shuguang Sun
# --
by ${3:usubjid};
${1:lagv} = ifn(first.${3:usubjid}, ., lag(${2:var}));